'''
Created on 18/06/2012

@author: rcasal
'''


if 0:
    None
    from _1_db_conn import dbAdmin

class UserRepository(object):
    '''
    classdocs
    '''
    @staticmethod    
    def findAll():
        return dbAdmin(dbAdmin.auth_user.id > 0).select()
    
    @staticmethod
    def finById(id): #@ReservedAssignment
        return dbAdmin(dbAdmin.auth_user.id == id).select().last()
    
    @staticmethod
    def save(form_vars): #@ReservedAssignment
        return dbAdmin.auth_user.insert(**dbAdmin.auth_user._filter_fields(form_vars))
        
     
